<script src="<?=base_url(); ?>theme/js/main.js"></script>
<h3>Buscador de productos</h3>
<div class="widget_wrap">
    <div class="form_container">
        <ul>
            <li>
                <div class="form_grid_12">
                    <div class="form_input">
                        <form id="listProductss" action="#" >
                            <div class="form_grid_4 alpha">
                                <input id="code" name="code" type="text" value="<?php echo $code; ?>" />
                                <span class=" label_intro">Código</span>
                            </div>
                            <div class="form_grid_6 ">
                                <input id="description" name="description" type="text" value="<?php echo $description ?>" />
                                <span class=" label_intro">Descripción</span>
                            </div>
                            <div class="form_grid_2 ">
                            <button  id="searchProducts" type="submit" class="btn_small btn_blue"><span>Buscar</span></button>
                            </div>
                        </form>

                        <span class="clear"></span>
                    </div>
                </div>
            </li>
        </ul>
    </div>
    
    <div class="widget_content">
      <form  id="search" action="#">
        <table id= "" class="wtbl_list">
            <thead id= "">
                <tr>
                    <th >Código</th>
                    <th  >Descripción</th>
                </tr>
            </thead>


            <tbody id="">

                <?php  
            foreach ($products as $p) : ?>
                    <tr   class="itemProductss tr_even  " codeProduct="<?php echo $p->code ?>" style="cursor: pointer;">   
                    <td><?php echo $p->code ?></td>
                    <td  id="" class="descriptionProduct"><input type="hidden" id="desc"  name="desc" value="<?php echo $p->description ?>"/><?php echo $p->description ?></td>
                    </tr>
                <?php endforeach; ?>


                
                <script type="text/javascript">
                  $('#search').click(function(){
                              var code = $('#code').val();
                              var warehouses = $('#description').val();
                               $.modal.close();                                    
                             }
                             
                          )
                </script>



                        </tbody>
                      </table>
                      </form>

                  </div>

                              
              </div>